package com.airbat.prize.common.enums;

import com.airbat.prize.common.core.LongArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 线索状态
 */
@Getter
@AllArgsConstructor
public enum ClueReportEnum implements LongArrayValuable {

    //类型 1阶段性 2终局性

    STAGED(1, "阶段性"),
    FINALITY(2, "终局性");

    /**
     * 值
     */
    private final long value;
    /**
     * 名称
     */
    private final String name;

    public static final long[] ARRAYS = Arrays.stream(values()).mapToLong(ClueReportEnum::getValue).toArray();

    @Override
    public long[] array() {
        return ARRAYS;
    }

    public static ClueReportEnum getEnum(long value) {
        return Arrays.stream(values()).filter(tr -> tr.getValue() == value).findFirst().get();
    }

}
